package com.hsteach.service.cookmenu;

import java.util.List;

import com.hsteach.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsteach.dao.mapper.cookmenu.CookmenuLikesMapper;
import com.hsteach.dao.domain.cookmenu.CookmenuLikes;

/**
 * 食堂菜品点赞记录Service业务层处理
 * 
 * @author fanxquer
 * @date 2023-11-07
 */
@Service
public class CookmenuLikesService
{
    @Autowired
    private CookmenuLikesMapper cookmenuLikesMapper;

    /**
     * 查询食堂菜品点赞记录
     * 
     * @param id 食堂菜品点赞记录主键
     * @return 食堂菜品点赞记录
     */
    public CookmenuLikes selectCookmenuLikesById(Long id)
    {
        return cookmenuLikesMapper.selectCookmenuLikesById(id);
    }

    /**
     * 查询食堂菜品点赞记录列表
     * 
     * @param cookmenuLikes 食堂菜品点赞记录
     * @return 食堂菜品点赞记录
     */
    public List<CookmenuLikes> selectCookmenuLikesList(CookmenuLikes cookmenuLikes)
    {
        return cookmenuLikesMapper.selectCookmenuLikesList(cookmenuLikes);
    }

    /**
     * 新增食堂菜品点赞记录
     * 
     * @param cookmenuLikes 食堂菜品点赞记录
     * @return 结果
     */
    public int insertCookmenuLikes(CookmenuLikes cookmenuLikes)
    {
        cookmenuLikes.setCreateTime(DateUtils.getNowDate());
        return cookmenuLikesMapper.insertCookmenuLikes(cookmenuLikes);
    }

    /**
     * 修改食堂菜品点赞记录
     * 
     * @param cookmenuLikes 食堂菜品点赞记录
     * @return 结果
     */
    public int updateCookmenuLikes(CookmenuLikes cookmenuLikes)
    {
        return cookmenuLikesMapper.updateCookmenuLikes(cookmenuLikes);
    }

    /**
     * 批量删除食堂菜品点赞记录
     * 
     * @param ids 需要删除的食堂菜品点赞记录主键
     * @return 结果
     */
    public int deleteCookmenuLikesByIds(List<Long> ids)
    {
        return cookmenuLikesMapper.deleteCookmenuLikesByIds(ids);
    }

    /**
     * 删除食堂菜品点赞记录信息
     * 
     * @param id 食堂菜品点赞记录主键
     * @return 结果
     */
    public int deleteCookmenuLikesById(Long id)
    {
        return cookmenuLikesMapper.deleteCookmenuLikesById(id);
    }
}
